<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>InputNumber 计数器 | MyWeb 4.x</title>
    <meta name="generator" content="VuePress 1.5.0">
    <link rel="icon" href="/my/favicon.ico">
    <script>
      var _hmt = _hmt || [];
      (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?c4e5f73318b5cb0c389e3d9a05f831cc";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
    <meta name="description" content="基于Vue + ElementUI 的web项目工程框架，专注于公检法行业中台系统快速搭建，框架已在多个项目实战检验。">
    <link rel="preload" href="/my/assets/css/0.styles.d7ae9199.css" as="style"><link rel="preload" href="/my/assets/js/app.2b2365a7.js" as="script"><link rel="preload" href="/my/assets/js/535.c100cd07.js" as="script"><link rel="preload" href="/my/assets/js/1278.f39c20fd.js" as="script"><link rel="preload" href="/my/assets/js/1025.8afc0690.js" as="script">
    <link rel="stylesheet" href="/my/assets/css/0.styles.d7ae9199.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/my/" class="home-link router-link-active"><img src="/my/img/logo.png" alt="MyWeb 4.x" class="logo"> <span class="site-name can-hide">MyWeb 4.x</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Basic</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>Form</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/my/element/cascader.html" class="sidebar-link">Cascader 级联选择器</a></li><li><a href="/my/element/checkbox.html" class="sidebar-link">Checkbox 多选框</a></li><li><a href="/my/element/color-picker.html" class="sidebar-link">ColorPicker 颜色选择器</a></li><li><a href="/my/element/date-picker.html" class="sidebar-link">DatePicker 日期选择器</a></li><li><a href="/my/element/datetime-picker.html" class="sidebar-link">DateTimePicker 日期时间选择器</a></li><li><a href="/my/element/form.html" class="sidebar-link">Form 表单</a></li><li><a href="/my/element/input.html" class="sidebar-link">Input 输入框</a></li><li><a href="/my/element/input-number.html" aria-current="page" class="active sidebar-link">InputNumber 计数器</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/my/element/input-number.html#基础用法" class="sidebar-link">基础用法</a></li><li class="sidebar-sub-header"><a href="/my/element/input-number.html#禁用状态" class="sidebar-link">禁用状态</a></li><li class="sidebar-sub-header"><a href="/my/element/input-number.html#步数" class="sidebar-link">步数</a></li><li class="sidebar-sub-header"><a href="/my/element/input-number.html#严格步数" class="sidebar-link">严格步数</a></li><li class="sidebar-sub-header"><a href="/my/element/input-number.html#精度" class="sidebar-link">精度</a></li><li class="sidebar-sub-header"><a href="/my/element/input-number.html#尺寸" class="sidebar-link">尺寸</a></li><li class="sidebar-sub-header"><a href="/my/element/input-number.html#按钮位置" class="sidebar-link">按钮位置</a></li><li class="sidebar-sub-header"><a href="/my/element/input-number.html#attributes" class="sidebar-link">Attributes</a></li><li class="sidebar-sub-header"><a href="/my/element/input-number.html#events" class="sidebar-link">Events</a></li><li class="sidebar-sub-header"><a href="/my/element/input-number.html#methods" class="sidebar-link">Methods</a></li></ul></li><li><a href="/my/element/radio.html" class="sidebar-link">Radio 单选框</a></li><li><a href="/my/element/rate.html" class="sidebar-link">Rate 评分</a></li><li><a href="/my/element/select.html" class="sidebar-link">Select 选择器</a></li><li><a href="/my/element/slider.html" class="sidebar-link">Slider 滑块</a></li><li><a href="/my/element/switch.html" class="sidebar-link">Switch 开关</a></li><li><a href="/my/element/time-picker.html" class="sidebar-link">TimePicker 时间选择器</a></li><li><a href="/my/element/transfer.html" class="sidebar-link">Transfer 穿梭框</a></li><li><a href="/my/element/upload.html" class="sidebar-link">Upload 上传</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Data</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Notice</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Navigation</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Others</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="inputnumber-计数器"><a href="#inputnumber-计数器" class="header-anchor">#</a> InputNumber 计数器</h1> <p>仅允许输入标准的数字值，可定义范围</p> <h2 id="基础用法"><a href="#基础用法" class="header-anchor">#</a> 基础用法</h2> <!----><h2 id="禁用状态"><a href="#禁用状态" class="header-anchor">#</a> 禁用状态</h2> <!----><h2 id="步数"><a href="#步数" class="header-anchor">#</a> 步数</h2> <p>允许定义递增递减的步数控制</p> <!----><h2 id="严格步数"><a href="#严格步数" class="header-anchor">#</a> 严格步数</h2> <!----><h2 id="精度"><a href="#精度" class="header-anchor">#</a> 精度</h2> <!----><div class="custom-block tip"><p class="custom-block-title">TIP</p> <p><code>precision</code> 的值必须是一个非负整数，并且不能小于 <code>step</code> 的小数位数。</p></div> <h2 id="尺寸"><a href="#尺寸" class="header-anchor">#</a> 尺寸</h2> <p>额外提供了 <code>medium</code>、<code>small</code>、<code>mini</code> 三种尺寸的数字输入框</p> <!----><h2 id="按钮位置"><a href="#按钮位置" class="header-anchor">#</a> 按钮位置</h2> <!----><h2 id="attributes"><a href="#attributes" class="header-anchor">#</a> Attributes</h2> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>value / v-model</td> <td>绑定值</td> <td>number</td> <td>—</td> <td>0</td></tr> <tr><td>min</td> <td>设置计数器允许的最小值</td> <td>number</td> <td>—</td> <td>-Infinity</td></tr> <tr><td>max</td> <td>设置计数器允许的最大值</td> <td>number</td> <td>—</td> <td>Infinity</td></tr> <tr><td>step</td> <td>计数器步长</td> <td>number</td> <td>—</td> <td>1</td></tr> <tr><td>step-strictly</td> <td>是否只能输入 step 的倍数</td> <td>number</td> <td>—</td> <td>false</td></tr> <tr><td>precision</td> <td>数值精度</td> <td>number</td> <td>—</td> <td>—</td></tr> <tr><td>size</td> <td>计数器尺寸</td> <td>string</td> <td>large, small</td> <td>—</td></tr> <tr><td>disabled</td> <td>是否禁用计数器</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>controls</td> <td>是否使用控制按钮</td> <td>boolean</td> <td>—</td> <td>true</td></tr> <tr><td>controls-position</td> <td>控制按钮位置</td> <td>string</td> <td>right</td> <td>-</td></tr> <tr><td>name</td> <td>原生属性</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>label</td> <td>输入框关联的label文字</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>placeholder</td> <td>输入框默认 placeholder</td> <td>string</td> <td>-</td> <td>-</td></tr></tbody></table> <h2 id="events"><a href="#events" class="header-anchor">#</a> Events</h2> <table><thead><tr><th>事件名称</th> <th>说明</th> <th>回调参数</th></tr></thead> <tbody><tr><td>change</td> <td>绑定值被改变时触发</td> <td>currentValue, oldValue</td></tr> <tr><td>blur</td> <td>在组件 Input 失去焦点时触发</td> <td>(event: Event)</td></tr> <tr><td>focus</td> <td>在组件 Input 获得焦点时触发</td> <td>(event: Event)</td></tr></tbody></table> <h2 id="methods"><a href="#methods" class="header-anchor">#</a> Methods</h2> <table><thead><tr><th>方法名</th> <th>说明</th> <th>参数</th></tr></thead> <tbody><tr><td>focus</td> <td>使 input 获取焦点</td> <td>-</td></tr> <tr><td>select</td> <td>选中 input 中的文字</td> <td>—</td></tr></tbody></table></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/my/element/input.html" class="prev">
        Input 输入框
      </a></span> <span class="next"><a href="/my/element/radio.html">
        Radio 单选框
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/my/assets/js/app.2b2365a7.js" defer></script><script src="/my/assets/js/535.c100cd07.js" defer></script><script src="/my/assets/js/1278.f39c20fd.js" defer></script><script src="/my/assets/js/1025.8afc0690.js" defer></script>
  </body>
</html>
